#pragma once
#ifndef _AS_SESSIOIN_MGR_H_
#define _AS_SESSION_MGR_H_

#include <map>
#include "net_include.h"
#include "thread_lock.h"

namespace as
{
namespace inet
{

class AsSessionMgr
{
public:
    AsSessionMgr() = default;
    ~AsSessionMgr() = default;

    void bind(int sid, std::shared_ptr<as::inet::AsSession> &session);
    void unbind(int sid);

    std::shared_ptr<as::inet::AsSession> find(int sid);

private:
    std::map<int, std::shared_ptr<as::inet::AsSession>> m_sessionMap;
    RWLock m_lock;
};



}
}



#endif